<?

include("config.php");

$i=0;

//On se connecte à la base de donnée
$link = mysql_connect ('localhost', DB_USER_NAME, DB_PASSWORD) or die ("Cannot join database");
mysql_select_db (DB_NAME);

$counter=mysql_query("SELECT COUNT(*) NBR_ENTREE FROM stream WHERE user='" . $_SESSION['pseudo'] . "'"); 
$row=mysql_fetch_object($counter); 
echo "<br>You added " . $row->NBR_ENTREE . " streams<br>"; 



echo 'Stream followed:<br>';
$result=mysql_query("SELECT * FROM abonnement WHERE user_v='" . $_SESSION['pseudo'] . "'"); 
while($row = mysql_fetch_array($result))
{
	$i++;
	echo '<a href="index.php?user=' .$row['id_user']. '">';
	echo '<img width="48" height="48" data-user-id="24744541" class="user-profile-link" title="' . $row['id_user'] . '" src="avatar/' . $row['id_user'] . '.jpg">';
	echo '</a>';
}
if($i == 0)
{
	echo '-';
}

$i=0;
echo '<br><br>People following your streams:<br>';
$result=mysql_query("SELECT * FROM abonnement WHERE id_user='" . $_SESSION['pseudo'] . "'"); 
while($row = mysql_fetch_array($result))
{
	$i++;
	echo '<a href="index.php?user=' .$row['user_v']. '">';
	echo '<img width="48" height="48" data-user-id="24744541" class="user-profile-link" title="' . $row['user_v'] . '" src="avatar/' . $row['user_v'] . '.jpg">';
	echo '</a>';
}
if($i == 0)
{
	echo '-';
}

?>
